feat: parse getRTK for mower devices#1587
Open
Beennnn wants to merge 1 commit into
Open
Conversation
21 tasks
Parses the cloud response of getRTK so consumers can read RTK status (rover/base satellite counts, signal scores, occlusion rates, base station SN/firmware) instead of only seeing it in the official Ecovacs Home app. Wired into the GOAT A1600 RTK (xmp9ds) capability tree as an optional CapabilityEvent on Capabilities.rtk; other devices stay unaffected (rtk defaults to None). Sample payload comes from a real GOAT A1600 RTK (firmware 1.15.13); tests cover the full payload and the no-base-station edge case.
2fe84c3 to
485e8d4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1587 +/- ##
==========================================
+ Coverage 94.99% 95.01% +0.01%
==========================================
Files 158 160 +2
Lines 6199 6262 +63
Branches 353 354 +1
==========================================
+ Hits 5889 5950 +61
- Misses 248 249 +1
- Partials 62 63 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parses the response of the existing
getRTKcloud command and notifies a newRtkEvent. The Ecovacs Home app already shows these counters under the GOAT's RTK settings screen but the library currently ignores the payload.Mapping (sample below comes from a real GOAT A1600 RTK on firmware 1.15.13):
observations.baseSolnSvs/roverSolnSvsbase_satellites_used/rover_satellites_usedrtks[0].starbase_stations[0].satellites_visibleobservations.roverSvsrover_satellites_visibleobservations.roverSignalScorerover_signal_score(0–100)Sample payload:
{ "result": 0, "rtks": [{"sn": "908276", "star": 30, "state": 0, "mode": 0, "version": "...,QD302 1.3.8,...,QD302 1.3.1"}], "observations": { "solStat": 0, "poseType": 50, "roverId": "908336", "roverSvs": 35, "roverSolnSvs": 30, "roverSignalRate": 44, "roverSignalScore": 90, "roverOcclusionRate": 8, "baseStnId": "\"1544\"", "baseSolnSvs": 29, "baseSignalRate": 45, "baseSignalScore": 94, "baseOcclusionRate": 24 } }Changes
deebot_client/events/rtk.py—RtkEvent+RtkBaseStationdataclassesdeebot_client/commands/json/rtk.py—GetRtkcommanddeebot_client/capabilities.py—Capabilities.rtk(optionalCapabilityEvent[RtkEvent])deebot_client/hardware/xmp9ds.py— wiresrtk=CapabilityEvent(RtkEvent, [GetRtk()])for the GOAT A1600 RTKtests/commands/json/test_rtk.py— full-payload + no-base-station casesOther devices stay unaffected (
rtkdefaults toNone).Test
uv run pytest tests/— 707 passed (705 existing + 2 new).